<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib tagdir="/WEB-INF/tags" prefix="mvc" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; utf-8">
    <title><s:text name="menu.admin.images" /> &mdash; <s:text name="application.name" /></title>
    <script type="text/javascript" src="/resources/other/ZeroClipboard.js"></script>
</head>
<body>

<script type="text/javascript">
    ZeroClipboard.setMoviePath('/resources/other/ZeroClipboard.swf');
    var clip = new ZeroClipboard.Client();
    function copyToClipboard(text, element) {
        clip = new ZeroClipboard.Client();
        clip.setText(text);
        clip.glue(element);
        clip.setHandCursor( true );
        clip.setCSSEffects( true );
    }
</script>

<mvc:h1 key="menu.admin.images" />
<mvc:message />

<s:form action="/admin/images!execute" method="post" id="menuItemsForm">
<s:select list="menuItems" key="parentItemKey" value="parentItemKey.string" emptyOption="true"
          onchange="document.getElementById('menuItemsForm').submit();"/>
</s:form>

<s:iterator value="images" var="img">
    <div class="image_block">
        <img class="icon" src="/image/image?imageId=${img.id}&icon=true" />
        <img  title="<s:text name="image.clipboard.tag" />" src="/resources/images/tag.png" class="link" onclick="copyToClipboard('<img src=\'<%=request.getScheme() + "://" + request.getServerName()+":"+request.getServerPort() %>/image/image?imageId=${img.id}\' />', this);" />
        <img  title="<s:text name="image.clipboard.link" />" src="/resources/images/link.png" class="link" onclick="copyToClipboard('<%=request.getScheme() + "://" + request.getServerName()+":"+request.getServerPort() %>/image/image?imageId=${img.id}', this);" />
        <a href="/admin/images!delete?imageId=${img.id}"  title="<s:text name="image.delete" />"
           onclick="return confirm('<s:text name="image.delete.confirmation" />');"><img src="/resources/images/remove.png" class="link"></a>
    </div>
</s:iterator>
<br class="clear" />





</body>
</html>